home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD-ROM Magazine 28 Bonus
/
CDRomMagazine-SoftKey-ArtPassion-FrenchVersion-Win31Mac.bin
/
data
/
shared.dir
/
03026_Script_ORIENTATION HANDLERS
< prev
next >
Wrap
Text File
|
1996-06-21
|
5KB
|
144 lines
-- --------------------------------------------------------
-- Handler setOrientationColors
on setOrientationColors where
global color_WasThere, color_HereNow
put where into field "Orientation"
set the foreColor of field "Orientation" to color_WasThere
set the itemDelimiter to ":"
put the number of items of field "Orientation" into numItems
set the foreColor of item numItems of field "Orientation" to color_HereNow
set the itemDelimiter to ","
end
-- --------------------------------------------------------
-- Handler setOrientation
on setOrientation scrollFlag
global blankSpaces, sectionOrientation, parentSection, color_WasThere,newOrientation
set newOrientation = buildOrientation(sectionOrientation, parentSection)
set the foreColor of field "Orientation" to color_WasThere
-- if scrollFlag then
-- set the itemDelimiter to ":"
-- put the number of items of newOrientation into numItems
--
-- -- the following if statement in case there is only 1 item in the orientation.
-- -- this way, the item doesn't both appear and get scrolled.
-- if (numItems > 1) then
-- put item 1 to (numItems -1) of newOrientation into staticText
-- else
-- put EMPTY into staticText
-- end if
--
-- put staticText & blankSpaces & item numItems of newOrientation into field "Orientation"
-- put length (staticText) + 1 into deletePos
-- set the itemDelimiter to ","
--
-- repeat with extra = length(blankSpaces) down to 1
-- delete char deletePos of field "Orientation"
-- end repeat
-- end if
setOrientationColors newOrientation
end
-- --------------------------------------------------------
-- Handler buildOrientation
on buildOrientation sectionOrientation, parentName
set currentOrientation = sectionOrientation
repeat while (parentName <> "0")
set parentOrientation = getParentOrientation(parentName)
if parentOrientation = "" then return currentOrientation
set currentOrientation = parentOrientation && ":" && currentOrientation
set parentName = getParentName(parentName)
end repeat
return currentOrientation
end
-- --------------------------------------------------------
-- Handler getParentOrientation
on getParentOrientation parentName
set parentSectionInfo = getSectionInfo(parentName)
if parentSectionInfo = "" then return "" -- ERROR
return getSectionOrientation(parentSectionInfo)
end
-- --------------------------------------------------------
-- Handler getParentName
on getParentName parentName
set parentSectionInfo = getSectionInfo(parentName)
if parentSectionInfo = "" then return "" -- ERROR
return getParentSection(parentSectionInfo)
end
-- --------------------------------------------------------
-- Handler clickOrientationText
on clickOrientationText
global currentSection,ancestor
if the mouseCast = the number of cast "Orientation" then
set the itemDelimiter to ":"
put the mouseItem into whichItem
hiliteOrientationItem(whichItem)
set numItems = the number of items in field "Orientation"
set the itemDelimiter to ","
if (whichItem = numItems) then
-- they clicked on the last item, just go to the beginning of the current section
-- this is used in cast the last item is just something like "example" and not
-- the name of a section
goSection(currentSection,0)
else
set ancestor = getAnscestor(whichItem, numItems, currentSection)
goSection(ancestor,0)
end if
end if
end
-- --------------------------------------------------------
-- Handler getAnscestor
on getAnscestor whichGeneration, numGenerations, currentSection
set prevGeneration = currentSection
repeat with i = whichGeneration to (numGenerations - 1)
set parentName = getParentName(prevGeneration)
set prevGeneration = parentName
end repeat
return prevGeneration
end
-- --------------------------------------------------------
-- Handler hiliteOrientationItem
on hiliteOrientationItem whichItem
--global hilitTextColor
if item whichItem of field "Orientation" contains ":" then exit -- DEBUG
set the foreColor of item whichItem of field "Orientation" = 186
repeat while (not the mouseUp)
nothing -- to keep it hilited
end repeat
end
-- --------------------------------------------------------
-- Handler clearOrientationField
on clearOrientationField
put " " into field "Orientation"
end